package com.ysstech.valuation.enums;

import com.ysstech.common.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * 系统常量
 *
 * @author lsl
 */
@Getter
@AllArgsConstructor
public enum ValuationTotalEnum implements BaseEnum<String> {
    NET_VALUE("101", "净值");


    private final String code;
    private final String desc;

    public static ValuationTotalEnum getEnum(String code) {
        return Arrays.stream(values()).filter(b -> Objects.equals(b.code, code)).findFirst().orElse(null);
    }

    public static String getEnumDesc(String code) {
        ValuationTotalEnum e = getEnum(code);
        return e != null ? e.desc : null;
    }
}
